package smlab.utils
{
	import flash.external.ExternalInterface;

	/**
	 * 将当前页面添加到浏览器收藏夹
	 * 调用的是 JS 的方法，因此页面中必须有对应的JS方法
	 * @author weiwei_zhang
	 * 
	 */
	public class AddToFavoriteUtil
	{
		public function AddToFavoriteUtil()
		{
		}
		
		public static function AddToFavorite(jsFunName:String="addfavorite"):void
		{
			var isAvailable:Boolean = ExternalInterface.available;
			
			if(isAvailable){
				try {
					ExternalInterface.call(jsFunName);
				} catch(e:Error) {
					trace("addfavorite Error");
				}
			}
		}
	}
}